﻿using ContactCenter.Core;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;

namespace ContactCenter.Persistence.NH.Tasks
{
    public class MsSqlDbTask : FluentTaskBase
    {
        public override bool CanConfigureCore()
        {
            return App.IsWeb();
        }

        public override FluentConfiguration ConfigureCore(FluentConfiguration configuration)
        {
            return configuration.Database(MsSqlConfiguration.MsSql2008
                                              .ConnectionString(c => c.FromConnectionStringWithKey("MyAppConnectionString"))
                                              .ShowSql());
        }
    }
}